package leetcode.leetcode_2221;

class Solution {
    public int triangularSum(int[] nums) {
        int n = nums.length;
        for(int i = n-1;i>0;i--){
            for (int j = 0;j<i;j++){
                nums[j] = (nums[j]+nums[j+1])%10;
            }
        }
        return nums[0];
        
    }
}